<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="robots" content="all" />
	<meta name="keywords" content="FLAG杯,FLAGcup,陆夫人,神奇陆夫人,bug体质,b站,bilibili" />
	<meta name="author" content="银发Victorique，svictorique@qq.com" />
	<link rel="shortcut icon" type="image/png" href="image/flagcup.png" />
	<title>FLAG杯 - 报名通道</title>
	<link rel="stylesheet" href="layui/css/layui.css"/>
	<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
<div class="logo_box">
  <div class="wrap">
  	<img class="logo" src="image/flagcup.png" alt="FLAGcup" />
  </div>
</div>
<div class="nav_box">
	<div class="wrap">
		<a class="nav" href="home.html">首页</a>
		<a class="nav" href="enroll.html">报名通道</a>
		<a class="nav" href="schedule.html">赛事赛程</a>
	</div>
</div>
<div class="wrap">
	<div class="enroll_group">
		<img class="poster" id="curPoster" src="image/enroll_coming_1.png"/>
		<a class="button" id="curEnroll" href="javascript:errorMsg('报名即将开始');">
			<img src="image/enroll_button_dark.png" />
		</a>
	</div>
	<div class="enroll_group">
		<img class="poster" src="image/enroll_finished.png"/>
		<a class="button disabled" href="javascript:errorMsg('报名已经结束');">
			<img src="image/enroll_button_dark.png" />
		</a>
	</div>
</div>
<div class="footer">
	<div class="wrap">
		<ul class="nav_group">
			<li class="title">投诉建议</li>
			<li class="nav"><a href="javascript:incomplete();">举报不良信息</a></li>
			<li class="nav"><a href="javascript:incomplete();">意见反馈</a></li>
			<li class="nav"><a href="javascript:incomplete();">比赛问题</a></li>
			<li class="nav"><a href="javascript:incomplete();">报名问题</a></li>
		</ul>
		<ul class="nav_group">
			<li class="title">FLAG杯工作组</li>
			<li class="nav"><a href="javascript:incomplete();">联系我们</a></li>
			<li class="nav"><a href="javascript:incomplete();">加入我们</a></li>
			<li class="nav"><a href="javascript:incomplete();">联系方式</a></li>
		</ul>
		<div class="qr_group">
			<img class="qr_code" src="image/qr_microblog.png"/>
			<div class="title">@神奇陆夫人</div>
			<div class="label">新浪微博</div>
		</div>
		<div class="qr_group">
			<img class="qr_code" src="image/qr_flagcup.png"/>
			<div class="title">@神奇陆夫人的Flag杯</div>
			<div class="label">新浪微博</div>
		</div>
		<div class="qr_group">
			<img class="qr_code" src="image/qr_public_number.png"/>
			<div class="title">神奇的陆夫人</div>
			<div class="label">微信公众号</div>
		</div>
	</div>
</div>
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="js/jquery-migrate-1.4.1.min.js"></script>
<script type="text/javascript" src="js/prefixfree.min.js"></script>
<script type="text/javascript" src="js/echarts.min.js"></script>
<script type="text/javascript" src="layui/layui.all.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
$(function(){
	$.ajax({
		url: 'data/enroll.json',
		dataType : 'json',
		type : 'get',
		success : function(d){
			var startTime = new Date(d.startTime);
			var endTime = new Date(d.endTime);
			var curTime = new Date();
			console.log(startTime)
			console.log(curTime);
			if(curTime.getTime() < startTime.getTime()){
				$("#curPoster").attr("src", d.comingUrl);
				$("#curEnroll").attr("href", "javascript:errorMsg('报名即将开始')");
				$("#curEnroll").attr("target", "");
				$("#curEnroll img").attr("src", "image/enroll_button_dark.png");
			} else if(curTime.getTime() > endTime.getTime()) {
				$("#curPoster").attr("src", d.finishedUrl);
				$("#curEnroll").attr("href", "javascript:errorMsg('报名已经结束')");
				$("#curEnroll").attr("target", "");
				$("#curEnroll img").attr("src", "image/enroll_button_dark.png");
			} else {
				$("#curPoster").attr("src", d.currentUrl);
				$("#curEnroll").attr("href", d.url);
				$("#curEnroll").attr("target", "_blank");
				$("#curEnroll img").attr("src", "image/enroll_button_light.png");
			}
		},
		error : function(xhr, msg, e){
			errorMsg(msg);
		}
	});
});
</script>
</body>
</html>